<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

// @official api list
// [!] 不推荐的写法
//Route::middleware(['pc.login'])->namespace('\App\Http\Controllers\Api')->group(function () {
//    Route::any('/inter/allow', 'InterController@allow')
//        ->middleware('pc.operating.log')->name('inter.allow');
//    Route::any('/article/list', 'ArticleController@list')->name('article.list');
//});
Route::middleware([\App\Http\Middleware\PcLoginCheck::class])->group(function () {
    //Route::any('/inter/allow', [\App\Http\Controllers\Api\InterController::class, 'allow'])->middleware(\App\Http\Middleware\PcOperatingLog::class)->name('inter.allow');
    //Route::any('/article/list', [\App\Http\Controllers\Api\ArticleController::class, 'list'])->name('article.list');
    //Route::any('/sys-tag-category/parent', [\App\Http\Controllers\Api\SysTagCategoryController::class, 'parent'])->name('sys-tag-category.parent');
    //Route::any('/article/index', [\App\Http\Controllers\Api\ArticleController::class, 'index'])->name('article.index');
    //Route::any('/author/recommend', [\App\Http\Controllers\Api\AuthorController::class, 'recommend'])->name('author.recommend');

    Route::post('/agreement/get-detail', [\App\Http\Controllers\Api\AgreementController::class, 'getDetail'])->name('agreement.get-detail');

    Route::post('/article/get-detail', [\App\Http\Controllers\Api\ArticleController::class, 'getDetail'])->name('article.get-detail');

    Route::post('/collect/add', [\App\Http\Controllers\Api\CollectController::class, 'add'])->name('collect.add');
    Route::post('/collect/cancel', [\App\Http\Controllers\Api\CollectController::class, 'cancel'])->name('collect.cancel');

    Route::post('/comment/add', [\App\Http\Controllers\Api\CommentController::class, 'add'])->name('comment.add');
    Route::post('/comment/del', [\App\Http\Controllers\Api\CommentController::class, 'del'])->name('comment.del');
    Route::post('/comment/list', [\App\Http\Controllers\Api\CommentController::class, 'getList'])->name('comment.list');

    Route::post('/dynamic/del', [\App\Http\Controllers\Api\DynamicController::class, 'del'])->name('dynamic.del');
    Route::post('/dynamic/get-detail', [\App\Http\Controllers\Api\DynamicController::class, 'getDetail'])->name('dynamic.get-detail');

    Route::post('/feedback/add', [\App\Http\Controllers\Api\FeedbackController::class, 'add'])->name('feedback.add');

    Route::post('/home/collect-list', [\App\Http\Controllers\Api\HomeController::class, 'collectList'])->name('home.collect-list');
    Route::post('/home/note-list', [\App\Http\Controllers\Api\HomeController::class, 'noteList'])->name('home.note-list');
    Route::post('/home/package-list', [\App\Http\Controllers\Api\HomeController::class, 'packageList'])->name('home.package-list');

    Route::post('/industry/add', [\App\Http\Controllers\Api\IndustryController::class, 'add'])->name('industry.add');
    Route::post('/industry/list', [\App\Http\Controllers\Api\IndustryController::class, 'getList'])->name('industry.list');
    Route::post('/inter/allow', [\App\Http\Controllers\Api\InterController::class, 'allow'])->name('inter.allow');
    Route::post('/inter/logout', [\App\Http\Controllers\Api\InterController::class, 'logout'])->name('inter.logout');

    Route::post('/job/add', [\App\Http\Controllers\Api\JobController::class, 'add'])->name('job.add');
    Route::post('/job/list', [\App\Http\Controllers\Api\JobController::class, 'getList'])->name('job.list');

    Route::post('/like/add', [\App\Http\Controllers\Api\LikeController::class, 'add'])->name('like.add');
    Route::post('/like/cancel', [\App\Http\Controllers\Api\LikeController::class, 'cancel'])->name('like.cancel');

    Route::post('/message/announce', [\App\Http\Controllers\Api\MessageController::class, 'announce'])->name('message.announce');
    Route::post('/message/clean', [\App\Http\Controllers\Api\MessageController::class, 'clean'])->name('message.clean');
    Route::post('/message/comment-receive', [\App\Http\Controllers\Api\MessageController::class, 'commentReceive'])->name('message.comment-receive');
    Route::post('/message/comment-send', [\App\Http\Controllers\Api\MessageController::class, 'commentSend'])->name('message.comment-send');
    Route::post('/message/like', [\App\Http\Controllers\Api\MessageController::class, 'like'])->name('message.like');
    Route::post('/message/unread', [\App\Http\Controllers\Api\MessageController::class, 'unread'])->name('message.unread');

    Route::post('/note/add', [\App\Http\Controllers\Api\NoteController::class, 'add'])->name('note.add');
    Route::post('/note/add-line', [\App\Http\Controllers\Api\NoteController::class, 'addLine'])->name('note.add-line');
    Route::post('/note/article-list', [\App\Http\Controllers\Api\NoteController::class, 'articleList'])->name('note.article-list');
    Route::post('/note/del', [\App\Http\Controllers\Api\NoteController::class, 'del'])->name('note.del');
    Route::post('/note/edit', [\App\Http\Controllers\Api\NoteController::class, 'edit'])->name('note.edit');
    Route::post('/note/get-detail', [\App\Http\Controllers\Api\NoteController::class, 'getDetail'])->name('note.get-detail');
    Route::post('/note/line-list', [\App\Http\Controllers\Api\NoteController::class, 'lineList'])->name('note.line-list');

    Route::post('/package/add', [\App\Http\Controllers\Api\PackageController::class, 'add'])->name('package.add');
    Route::post('/package/del', [\App\Http\Controllers\Api\PackageController::class, 'del'])->name('package.del');
    Route::post('/package/edit', [\App\Http\Controllers\Api\PackageController::class, 'edit'])->name('package.edit');
    Route::post('/package/get-detail', [\App\Http\Controllers\Api\PackageController::class, 'getDetail'])->name('package.get-detail');
    Route::post('/package/list', [\App\Http\Controllers\Api\PackageController::class, 'getList'])->name('package.list');
    Route::post('/package/more-list', [\App\Http\Controllers\Api\PackageController::class, 'moreList'])->name('package.more-list');
    Route::post('/package/target-list', [\App\Http\Controllers\Api\PackageController::class, 'targetList'])->name('package.target-list');

    Route::post('/pro-category/list', [\App\Http\Controllers\Api\ProCategoryController::class, 'getList'])->name('pro-category.list');
    Route::post('/pro/list', [\App\Http\Controllers\Api\ProController::class, 'getList'])->name('pro.list');
    Route::post('/pro/recommend-list', [\App\Http\Controllers\Api\ProController::class, 'recommendList'])->name('pro.recommend-list');

    Route::post('/quick/collect', [\App\Http\Controllers\Api\QuickController::class, 'collect'])->name('quick.collect');
    Route::post('/quick/preview', [\App\Http\Controllers\Api\QuickController::class, 'preview'])->name('quick.preview');

    Route::post('/relationship/add', [\App\Http\Controllers\Api\RelationshipController::class, 'add'])->name('relationship.add');
    Route::post('/relationship/cancel', [\App\Http\Controllers\Api\RelationshipController::class, 'cancel'])->name('relationship.cancel');
    Route::post('/relationship/follower', [\App\Http\Controllers\Api\RelationshipController::class, 'follower'])->name('relationship.follower');
    Route::post('/relationship/following', [\App\Http\Controllers\Api\RelationshipController::class, 'following'])->name('relationship.following');

    Route::post('/reply/add', [\App\Http\Controllers\Api\ReplyController::class, 'add'])->name('reply.add');
    Route::post('/reply/del', [\App\Http\Controllers\Api\ReplyController::class, 'del'])->name('reply.del');
    Route::post('/reply/list', [\App\Http\Controllers\Api\ReplyController::class, 'getList'])->name('reply.list');

    Route::post('/report/add', [\App\Http\Controllers\Api\ReportController::class, 'add'])->name('report.add');

    Route::post('/search/article', [\App\Http\Controllers\Api\SearchController::class, 'article'])->name('search.article');
    Route::post('/search/user', [\App\Http\Controllers\Api\SearchController::class, 'user'])->name('search.user');
    Route::post('/share/upload', [\App\Http\Controllers\Api\ShareController::class, 'upload'])->name('share.upload');

    Route::post('/site/phone-login', [\App\Http\Controllers\Api\SiteController::class, 'phoneLogin'])->name('site.phone-login');
    Route::post('/site/pwd-login', [\App\Http\Controllers\Api\SiteController::class, 'pwdLogin'])->name('site.pwd-login');

    Route::post('/sms/send', [\App\Http\Controllers\Api\SmsController::class, 'send'])->name('sms.send');

    Route::post('/square/attention-list', [\App\Http\Controllers\Api\SquareController::class, 'attentionList'])->name('square.attention-list');
    Route::post('/square/recommend-list', [\App\Http\Controllers\Api\SquareController::class, 'recommendList'])->name('square.recommend-list');

    Route::post('/user/avatar', [\App\Http\Controllers\Api\UserController::class, 'avatar'])->name('user.avatar');
    Route::post('/user/change-phone', [\App\Http\Controllers\Api\UserController::class, 'changePhone'])->name('user.change-phone');
    Route::post('/user/dynamic-list', [\App\Http\Controllers\Api\UserController::class, 'dynamicList'])->name('user.dynamic-list');
    Route::post('/user/edit', [\App\Http\Controllers\Api\UserController::class, 'edit'])->name('user.edit');
    Route::post('/user/get-detail', [\App\Http\Controllers\Api\UserController::class, 'getDetail'])->name('user.get-detail');
    Route::post('/user/get-info', [\App\Http\Controllers\Api\UserController::class, 'getInfo'])->name('user.get-info');
    Route::post('/user/like-list', [\App\Http\Controllers\Api\UserController::class, 'likeList'])->name('user.like-list');
    Route::post('/user/note-list', [\App\Http\Controllers\Api\UserController::class, 'noteList'])->name('user.note-list');
    Route::post('/user/package-list', [\App\Http\Controllers\Api\UserController::class, 'packageList'])->name('user.package-list');
    Route::post('/user/re-pwd', [\App\Http\Controllers\Api\UserController::class, 'rePwd'])->name('user.re-pwd');
    Route::post('/user/unbind-wx', [\App\Http\Controllers\Api\UserController::class, 'unbindWx'])->name('user.unbind-wx');

});

// test route
Route::any('/test/cache', [\App\Http\Controllers\Api\TestController::class, 'cache'])->name('test.cache');
Route::any('/test/redis', [\App\Http\Controllers\Api\TestController::class, 'redis'])->name('test.redis');
Route::any('/test/queue', [\App\Http\Controllers\Api\TestController::class, 'queue'])->name('test.queue');
Route::any('/test/event', [\App\Http\Controllers\Api\TestController::class, 'event'])->name('test.event');
Route::any('/test/http', [\App\Http\Controllers\Api\TestController::class, 'http'])->name('test.http');
Route::any('/test/download', [\App\Http\Controllers\Api\TestController::class, 'download'])->name('test.download');
Route::post('/test/upload', [\App\Http\Controllers\Api\TestController::class, 'upload'])->name('test.upload');
Route::post('/test/oss', [\App\Http\Controllers\Api\TestController::class, 'oss'])->name('test.oss');
Route::any('/test/es', [\App\Http\Controllers\Api\TestController::class, 'es'])->name('test.es');

